#ifndef UNIAST_RUNTIME_TYPE_H
#define UNIAST_RUNTIME_TYPE_H
#include "mlir/IR/Builders.h"
#include "mlir/IR/Types.h"
#include <memory>
#include <string>

namespace UniAST
{
class Type
{
  protected:
    std::string name;

  public:
    Type() = default;
    Type(std::string name);
    Type(const Type &) = default;
    Type(Type &&) = default;
    Type &operator=(const Type &) = default;
    virtual ~Type() = default;
    std::string getName();
    virtual mlir::Type getmlirType(mlir::OpBuilder &builder);
    bool isIntegerType();
    bool isFloatType();
};
class IntegerType : public Type
{
  private:
    int size;

  public:
    IntegerType(std::string name, int size);
    virtual mlir::Type getmlirType(mlir::OpBuilder &builder) override;
    static std::shared_ptr<IntegerType> get(int size);
};
class FloatType : public Type
{
  private:
    int size;

  public:
    FloatType(std::string name, int size);
    virtual mlir::Type getmlirType(mlir::OpBuilder &builder) override;
    static std::shared_ptr<FloatType> get(int size);
};

} // namespace UniAST

#endif